/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import dao.UserDaoImpl;
import entities1.Users;
import javax.inject.Inject;

/**
 *
 * @author takamflore
 */
public class RegistrationBean {
     @Inject
    private UserDaoImpl um;

    private Users user;

    public RegistrationBean() {
    }

    public Users getUser() {
        if (user == null){
            user = new Users();
        }
        return user;
    }

    public void setUser(Users user) {
        this.user = user;
    }

    public String register() {
        um.addUser(user);
        return "user/home?faces-redirect=true";
    }

}
